package com.mxpio.erp.plm.controller;

import com.mxpio.erp.common.plm.entity.ProjectDeliverable;
import com.mxpio.erp.common.plm.entity.ProjectDeliverableDraft;
import com.mxpio.erp.common.plm.service.ProjectDeliverableDraftService;
import com.mxpioframework.common.vo.Result;
import com.mxpioframework.jpa.query.Criteria;
import com.mxpioframework.jpa.query.Operator;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "ProjectDeliverableDraftController", description = "项目-交付物-草稿表")
@RestController
@RequestMapping("/erp/plm/pro/deliverables/draft/")
public class ProjectDeliverableDraftController {
    @Autowired
    private ProjectDeliverableDraftService projectDeliverableDraftService;
    @GetMapping("list/pro/{bizNo}")
    @Operation(summary = "根据项目编码获取项目交付物", description = "根据项目编码获取项目交付物", method = "GET")
    public Result<List<ProjectDeliverableDraft>> getByList(@PathVariable(name = "bizNo", required = true) String bizNo) {
        List<ProjectDeliverableDraft> drafts = projectDeliverableDraftService.getDraft(bizNo);
        return Result.OK(drafts);
    }
}
